package com.aaa.sas.controller;

import com.aaa.pojo.Pagesas;
import com.aaa.pojo.ResultBeansas;
import com.aaa.pojo.question_sas;
import com.aaa.sas.service.AccountServicesas;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/accountsas")
@ResponseBody
public class AccountControllersas {
    @Autowired
    private AccountServicesas accountServicesas;
    @RequestMapping(value = "/findAllsas"/*, produces = {"application/json;charset=UTF-8"}*/)

    public ResultBeansas findAll(Pagesas pagesas,question_sas question_sas) {
     /*   List<question_fpa> list = accountService.findAll();
        model.addAttribute("list", list);*/
        return accountServicesas.findAll(pagesas,question_sas);
    }
    @RequestMapping("/deletesas")
        public  int delete(Integer id){
        int delete = accountServicesas.delete(id);

/*        ResultBean resultBean = new ResultBean();
        if (delete){
            resultBean.setCode(0);
            resultBean.setMsg("删除成功");
        }else {
            resultBean.setCode(1);
            resultBean.setMsg("删除成功");
        }*/
        return delete;
    }
    @RequestMapping("/updatesas")
    public  int update(question_sas question_sas){
        return accountServicesas.update(question_sas);
    }
    @RequestMapping("/deletessas")
    public  int deletes(@RequestParam Integer[] id){
        return accountServicesas.deletes(id);

    }
    @RequestMapping("/savesas")
    public  int save(question_sas question_sas){
        return accountServicesas.save(question_sas);

    }

}
